package com.bins.uaa.common.constants;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@NoArgsConstructor
public class ResponseBody implements ResponseConstant {

    boolean success = SUCCESS;

    int code = SUCCESS_CODE;

    String message;

    public ResponseBody(ResponseAction action){
        this.success = action.success();
        this.code = action.code();
        this.message = action.message();
    }

    public static ResponseBody SUCCESS(){
        return new ResponseBody(CommonCode.SUCCESS);
    }
    public static ResponseBody FAIL(){
        return new ResponseBody(CommonCode.FAIL);
    }

}
